#include "Light.h"
#include "Matrix4.h"

Light::Light() : 
m_cutOffAngle(180.0f),
m_exponent(0.0f),
m_cAttenuation(1.0f),
m_lAttenuation(0.0f),
m_qAttenuation(0.0f),
m_drawn(false),
m_spotlight(false),
m_attenuated(false),
m_id(-1)
{}

void Light::SetUp() const
{
}

void Light::TurnOn()
{
    
}
void Light::TurnOff()
{
    
}

void Light::SetAll( const Vec4f& pos,           const Vec4f& ambient,
                    const Vec4f& diffuse,       const Vec4f& specular,
                    const Vec3f& direction,     const float& cutoffangle, 
                    const float& exponent,      const float& cattenuation, 
                    const float& lattenuation,  const float& qattenuation, 
                    const bool drawn,           const bool spotlight,
                    const bool attenuated,      const int ID)
{
    m_id            = ID;
    m_pos           = pos;
    m_ambient       = ambient;
    m_diffuse       = diffuse;
    m_specular      = specular;
    m_direction     = direction;
    m_cutOffAngle   = cutoffangle;
    m_exponent      = exponent;
    m_cAttenuation  = cattenuation;
    m_lAttenuation  = lattenuation;
    m_qAttenuation  = qattenuation;
    m_drawn         = drawn;
    m_spotlight     = spotlight;
    m_attenuated    = attenuated;
}
void Light::Draw() const
{
}
void Light::SetAmbient(const Vec4f& amb)
{
    m_ambient = amb;
}
void Light::SetDiffuse(const Vec4f& dif)
{
    m_diffuse = dif;
}
void Light::SetSpecular(const Vec4f& spec)
{
    m_specular = spec;
}
void Light::SetPosition(const Vec4f& pos)
{
    m_pos = pos;
}
void Light::SetDirection(const Vec3f& dir)
{
    m_direction = dir;
}
void Light::SetId(int id)
{
    m_id = id;
}
const int Light::GetId() const
{
    return m_id;
}
void Light::ShouldDraw(bool draw)
{
    m_drawn = draw;
}
void Light::ShouldSpot(bool spot)
{
    m_spotlight = spot;
}
void Light::ShouldAttenuate(bool att)
{
    m_attenuated = att;
}

Vec3f Light::CopyPos() const
{
    return m_pos.GetVec3();
}
const Vec3f& Light::GetDirection() const
{
    return m_direction;
}
